import 'package:gluz/generated/json/base/json_convert_content.dart';
import 'package:gluz/app/data/shop/shop_list_entity.dart';
import 'package:dartx/dartx.dart';

import 'package:gluz/app/common/extension/string_extension.dart';


ShopListEntity $ShopListEntityFromJson(Map<String, dynamic> json) {
  final ShopListEntity shopListEntity = ShopListEntity();
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    shopListEntity.id = id;
  }
  final int? skuId = jsonConvert.convert<int>(json['skuId']);
  if (skuId != null) {
    shopListEntity.skuId = skuId;
  }
  final int? spuId = jsonConvert.convert<int>(json['spuId']);
  if (spuId != null) {
    shopListEntity.spuId = spuId;
  }
  final dynamic userId = json['userId'];
  if (userId != null) {
    shopListEntity.userId = userId;
  }
  final String? skuName = jsonConvert.convert<String>(json['skuName']);
  if (skuName != null) {
    shopListEntity.skuName = skuName;
  }
  final String? spuName = jsonConvert.convert<String>(json['spuName']);
  if (spuName != null) {
    shopListEntity.spuName = spuName;
  }
  final int? classId = jsonConvert.convert<int>(json['classId']);
  if (classId != null) {
    shopListEntity.classId = classId;
  }
  final String? className = jsonConvert.convert<String>(json['className']);
  if (className != null) {
    shopListEntity.className = className;
  }
  final String? allClassName = jsonConvert.convert<String>(
      json['allClassName']);
  if (allClassName != null) {
    shopListEntity.allClassName = allClassName;
  }
  final int? brandId = jsonConvert.convert<int>(json['brandId']);
  if (brandId != null) {
    shopListEntity.brandId = brandId;
  }
  final String? brandName = jsonConvert.convert<String>(json['brandName']);
  if (brandName != null) {
    shopListEntity.brandName = brandName;
  }
  final String? suppName = jsonConvert.convert<String>(json['suppName']);
  if (suppName != null) {
    shopListEntity.suppName = suppName;
  }
  final String? suppCode = jsonConvert.convert<String>(json['suppCode']);
  if (suppCode != null) {
    shopListEntity.suppCode = suppCode;
  }
  final int? venderId = jsonConvert.convert<int>(json['venderId']);
  if (venderId != null) {
    shopListEntity.venderId = venderId;
  }
  final int? salesPrice = jsonConvert.convert<int>(json['salesPrice']);
  if (salesPrice != null) {
    shopListEntity.salesPrice = salesPrice;
  }
  final String? salesCurrency = jsonConvert.convert<String>(
      json['salesCurrency']);
  if (salesCurrency != null) {
    shopListEntity.salesCurrency = salesCurrency;
  }
  final int? stockNum = jsonConvert.convert<int>(json['stockNum']);
  if (stockNum != null) {
    shopListEntity.stockNum = stockNum;
  }
  final int? stockStateType = jsonConvert.convert<int>(json['stockStateType']);
  if (stockStateType != null) {
    shopListEntity.stockStateType = stockStateType;
  }
  final String? stockStateDesc = jsonConvert.convert<String>(
      json['stockStateDesc']);
  if (stockStateDesc != null) {
    shopListEntity.stockStateDesc = stockStateDesc;
  }
  final int? isAreaRestrict = jsonConvert.convert<int>(json['isAreaRestrict']);
  if (isAreaRestrict != null) {
    shopListEntity.isAreaRestrict = isAreaRestrict;
  }
  final int? thirdSkuSource = jsonConvert.convert<int>(json['thirdSkuSource']);
  if (thirdSkuSource != null) {
    shopListEntity.thirdSkuSource = thirdSkuSource;
  }
  final int? skuState = jsonConvert.convert<int>(json['skuState']);
  if (skuState != null) {
    shopListEntity.skuState = skuState;
  }
  final int? skuType = jsonConvert.convert<int>(json['skuType']);
  if (skuType != null) {
    shopListEntity.skuType = skuType;
  }
  final int? selfSellType = jsonConvert.convert<int>(json['selfSellType']);
  if (selfSellType != null) {
    shopListEntity.selfSellType = selfSellType;
  }
  final int? saleModel = jsonConvert.convert<int>(json['saleModel']);
  if (saleModel != null) {
    shopListEntity.saleModel = saleModel;
  }
  final String? mainPicUrl = jsonConvert.convert<String>(json['mainPicUrl']);
  if (mainPicUrl != null) {
    shopListEntity.mainPicUrl = mainPicUrl;
  }
  final int? lowestBuy = jsonConvert.convert<int>(json['lowestBuy']);
  if (lowestBuy != null) {
    shopListEntity.lowestBuy = lowestBuy;
  }
  final int? deliveryTime = jsonConvert.convert<int>(json['deliveryTime']);
  if (deliveryTime != null) {
    shopListEntity.deliveryTime = deliveryTime;
  }
  final int? logisticsType = jsonConvert.convert<int>(json['logisticsType']);
  if (logisticsType != null) {
    shopListEntity.logisticsType = logisticsType;
  }
  final int? logisticsState = jsonConvert.convert<int>(json['logisticsState']);
  if (logisticsState != null) {
    shopListEntity.logisticsState = logisticsState;
  }
  final int? collectionsTotal = jsonConvert.convert<int>(
      json['collectionsTotal']);
  if (collectionsTotal != null) {
    shopListEntity.collectionsTotal = collectionsTotal;
  }
  final String? createdTime = jsonConvert.convert<String>(json['createdTime']);
  if (createdTime != null) {
    shopListEntity.createdTime = createdTime;
  }
  final String? updatedTime = jsonConvert.convert<String>(json['updatedTime']);
  if (updatedTime != null) {
    shopListEntity.updatedTime = updatedTime;
  }
  final String? currencyUnit = jsonConvert.convert<String>(
      json['currencyUnit']);
  if (currencyUnit != null) {
    shopListEntity.currencyUnit = currencyUnit;
  }
  final String? minOrderQuantity = jsonConvert.convert<String>(
      json['minOrderQuantity']);
  if (minOrderQuantity != null) {
    shopListEntity.minOrderQuantity = minOrderQuantity;
  }
  final String? wholesalePrice = jsonConvert.convert<String>(
      json['wholesalePrice']);
  if (wholesalePrice != null) {
    shopListEntity.wholesalePrice = wholesalePrice;
  }
  final String? totalStock = jsonConvert.convert<String>(json['totalStock']);
  if (totalStock != null) {
    shopListEntity.totalStock = totalStock;
  }
  final String? shippingAddress = jsonConvert.convert<String>(
      json['shippingAddress']);
  if (shippingAddress != null) {
    shopListEntity.shippingAddress = shippingAddress;
  }
  final String? productDescription = jsonConvert.convert<String>(
      json['productDescription']);
  if (productDescription != null) {
    shopListEntity.productDescription = productDescription;
  }
  final int? isConsignment = jsonConvert.convert<int>(json['isConsignment']);
  if (isConsignment != null) {
    shopListEntity.isConsignment = isConsignment;
  }
  final dynamic detail = json['detail'];
  if (detail != null) {
    shopListEntity.detail = detail;
  }
  final String? images = jsonConvert.convert<String>(json['images']);
  if (images != null) {
    shopListEntity.images = images;
  }
  final int? pageView = jsonConvert.convert<int>(json['pageView']);
  if (pageView != null) {
    shopListEntity.pageView = pageView;
  }
  final String? userName = jsonConvert.convert<String>(json['userName']);
  if (userName != null) {
    shopListEntity.userName = userName;
  }
  final String? userImg = jsonConvert.convert<String>(json['userImg']);
  if (userImg != null) {
    shopListEntity.userImg = userImg;
  }
  final String? userCountry = jsonConvert.convert<String>(json['userCountry']);
  if (userCountry != null) {
    shopListEntity.userCountry = userCountry;
  }
  final String? memberLevel = jsonConvert.convert<String>(json['memberLevel']);
  if (memberLevel != null) {
    shopListEntity.memberLevel = memberLevel;
  }
  final int? isSample = jsonConvert.convert<int>(json['isSample']);
  if (isSample != null) {
    shopListEntity.isSample = isSample;
  }
  return shopListEntity;
}

Map<String, dynamic> $ShopListEntityToJson(ShopListEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['id'] = entity.id;
  data['skuId'] = entity.skuId;
  data['spuId'] = entity.spuId;
  data['userId'] = entity.userId;
  data['skuName'] = entity.skuName;
  data['spuName'] = entity.spuName;
  data['classId'] = entity.classId;
  data['className'] = entity.className;
  data['allClassName'] = entity.allClassName;
  data['brandId'] = entity.brandId;
  data['brandName'] = entity.brandName;
  data['suppName'] = entity.suppName;
  data['suppCode'] = entity.suppCode;
  data['venderId'] = entity.venderId;
  data['salesPrice'] = entity.salesPrice;
  data['salesCurrency'] = entity.salesCurrency;
  data['stockNum'] = entity.stockNum;
  data['stockStateType'] = entity.stockStateType;
  data['stockStateDesc'] = entity.stockStateDesc;
  data['isAreaRestrict'] = entity.isAreaRestrict;
  data['thirdSkuSource'] = entity.thirdSkuSource;
  data['skuState'] = entity.skuState;
  data['skuType'] = entity.skuType;
  data['selfSellType'] = entity.selfSellType;
  data['saleModel'] = entity.saleModel;
  data['mainPicUrl'] = entity.mainPicUrl;
  data['lowestBuy'] = entity.lowestBuy;
  data['deliveryTime'] = entity.deliveryTime;
  data['logisticsType'] = entity.logisticsType;
  data['logisticsState'] = entity.logisticsState;
  data['collectionsTotal'] = entity.collectionsTotal;
  data['createdTime'] = entity.createdTime;
  data['updatedTime'] = entity.updatedTime;
  data['currencyUnit'] = entity.currencyUnit;
  data['minOrderQuantity'] = entity.minOrderQuantity;
  data['wholesalePrice'] = entity.wholesalePrice;
  data['totalStock'] = entity.totalStock;
  data['shippingAddress'] = entity.shippingAddress;
  data['productDescription'] = entity.productDescription;
  data['isConsignment'] = entity.isConsignment;
  data['detail'] = entity.detail;
  data['images'] = entity.images;
  data['pageView'] = entity.pageView;
  data['userName'] = entity.userName;
  data['userImg'] = entity.userImg;
  data['userCountry'] = entity.userCountry;
  data['memberLevel'] = entity.memberLevel;
  data['isSample'] = entity.isSample;
  return data;
}

extension ShopListEntityExtension on ShopListEntity {
  ShopListEntity copyWith({
    String? id,
    int? skuId,
    int? spuId,
    dynamic userId,
    String? skuName,
    String? spuName,
    int? classId,
    String? className,
    String? allClassName,
    int? brandId,
    String? brandName,
    String? suppName,
    String? suppCode,
    int? venderId,
    int? salesPrice,
    String? salesCurrency,
    int? stockNum,
    int? stockStateType,
    String? stockStateDesc,
    int? isAreaRestrict,
    int? thirdSkuSource,
    int? skuState,
    int? skuType,
    int? selfSellType,
    int? saleModel,
    String? mainPicUrl,
    int? lowestBuy,
    int? deliveryTime,
    int? logisticsType,
    int? logisticsState,
    int? collectionsTotal,
    String? createdTime,
    String? updatedTime,
    String? currencyUnit,
    String? minOrderQuantity,
    String? wholesalePrice,
    String? totalStock,
    String? shippingAddress,
    String? productDescription,
    int? isConsignment,
    dynamic detail,
    String? images,
    int? pageView,
    String? userName,
    String? userImg,
    String? userCountry,
    String? memberLevel,
    int? isSample,
  }) {
    return ShopListEntity()
      ..id = id ?? this.id
      ..skuId = skuId ?? this.skuId
      ..spuId = spuId ?? this.spuId
      ..userId = userId ?? this.userId
      ..skuName = skuName ?? this.skuName
      ..spuName = spuName ?? this.spuName
      ..classId = classId ?? this.classId
      ..className = className ?? this.className
      ..allClassName = allClassName ?? this.allClassName
      ..brandId = brandId ?? this.brandId
      ..brandName = brandName ?? this.brandName
      ..suppName = suppName ?? this.suppName
      ..suppCode = suppCode ?? this.suppCode
      ..venderId = venderId ?? this.venderId
      ..salesPrice = salesPrice ?? this.salesPrice
      ..salesCurrency = salesCurrency ?? this.salesCurrency
      ..stockNum = stockNum ?? this.stockNum
      ..stockStateType = stockStateType ?? this.stockStateType
      ..stockStateDesc = stockStateDesc ?? this.stockStateDesc
      ..isAreaRestrict = isAreaRestrict ?? this.isAreaRestrict
      ..thirdSkuSource = thirdSkuSource ?? this.thirdSkuSource
      ..skuState = skuState ?? this.skuState
      ..skuType = skuType ?? this.skuType
      ..selfSellType = selfSellType ?? this.selfSellType
      ..saleModel = saleModel ?? this.saleModel
      ..mainPicUrl = mainPicUrl ?? this.mainPicUrl
      ..lowestBuy = lowestBuy ?? this.lowestBuy
      ..deliveryTime = deliveryTime ?? this.deliveryTime
      ..logisticsType = logisticsType ?? this.logisticsType
      ..logisticsState = logisticsState ?? this.logisticsState
      ..collectionsTotal = collectionsTotal ?? this.collectionsTotal
      ..createdTime = createdTime ?? this.createdTime
      ..updatedTime = updatedTime ?? this.updatedTime
      ..currencyUnit = currencyUnit ?? this.currencyUnit
      ..minOrderQuantity = minOrderQuantity ?? this.minOrderQuantity
      ..wholesalePrice = wholesalePrice ?? this.wholesalePrice
      ..totalStock = totalStock ?? this.totalStock
      ..shippingAddress = shippingAddress ?? this.shippingAddress
      ..productDescription = productDescription ?? this.productDescription
      ..isConsignment = isConsignment ?? this.isConsignment
      ..detail = detail ?? this.detail
      ..images = images ?? this.images
      ..pageView = pageView ?? this.pageView
      ..userName = userName ?? this.userName
      ..userImg = userImg ?? this.userImg
      ..userCountry = userCountry ?? this.userCountry
      ..memberLevel = memberLevel ?? this.memberLevel
      ..isSample = isSample ?? this.isSample;
  }
}